﻿#pragma once
#include "yzrutil.h"

namespace yzrilyzr_lang{
	EBCLASS(Thread){
		typedef void * yzrilyzr_lang_thread_handle;
	private:
	yzrilyzr_lang_thread_handle mHandle=nullptr;
	public:
	enum Priority{
		LOW, NORMAL, HIGH
	};
	Thread(yzrilyzr_lang_thread_handle h);
	Thread();
	void setName(const yzrilyzr_lang::String & name);
	void setPriority(Priority p);
	void join();
	static void sleep(int64_t millis);
	static void sleep(int64_t millis, int64_t nanos);
	static void yield();
	static std::shared_ptr<Thread> currentThread();
	};
}